package com.ruihu.admin.module.business.tasknode.domain.vo;

import com.ruihu.admin.module.business.tasknode.domain.dto.NodeInstProcessRelationDTO;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;

/**
 *  [  ]
 *
 * @author Tony
 * @version 1.0
 * @company 瑞虎（南京）信息技术有限公司
 * @copyright (c) 瑞虎（南京）信息技术有限公司Inc. All rights reserved.
 * @date  2023-01-03 14:55:43
 * @since JDK1.8
 */

@Data
public class NodeInstProcessRelationVO {
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("流程配置表ID")
    private Long processConfigId;

    @ApiModelProperty("任务环节实例ID")
    private Long taskNodeInstId;

    @ApiModelProperty("子任务环节实例ID")
    private Long subTaskNodeInstId;

    @ApiModelProperty("缺陷类型ID")
    private Long defectTypeId;

    @ApiModelProperty("缺陷类型名称")
    private String defectTypeName;

    @ApiModelProperty("名称")
    private String configKey;

    @ApiModelProperty("固定值")
    private String configValue;

    @ApiModelProperty("单位")
    private String unit;

    @ApiModelProperty("单选值")
    private String selectValue;

    @ApiModelProperty("描述")
    private String descr;

    @ApiModelProperty("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;


    public static NodeInstProcessRelationVO convertToNodeInstProcessRelationVO(NodeInstProcessRelationDTO dto) {
        if (dto == null){
            return null;
        }
        NodeInstProcessRelationVO vo = new NodeInstProcessRelationVO();
        vo.setId(dto.getId());
         vo.setProcessConfigId(dto.getProcessConfigId());
         vo.setTaskNodeInstId(dto.getTaskNodeInstId());
         vo.setSubTaskNodeInstId(dto.getSubTaskNodeInstId());
         vo.setDefectTypeId(dto.getDefectTypeId());
         vo.setDefectTypeName(dto.getDefectTypeName());
         vo.setConfigKey(dto.getConfigKey());
         vo.setConfigValue(dto.getConfigValue());
         vo.setUnit(dto.getUnit());
         vo.setSelectValue(dto.getSelectValue());
         vo.setDescr(dto.getDescr());
         vo.setCreateTime(dto.getCreateTime());
         vo.setUpdateTime(dto.getUpdateTime());
         return vo;
    }
}
